/*********************************************************
          File Name:11.3.cpp
          Author: Abby Cin
          Mail: abbytsing@gmail.com
          Created Time: Sun 20 Sep 2015 07:15:49 PM CST
**********************************************************/

#include <iostream>
#include <string>
#include <map>

auto word_count(void) -> std::map<std::string, size_t>
{
        std::map<std::string, size_t> count;
        std::string word;
        while(std::cin >> word)
        {
                ++count[word];
        }
        return count;
}

int main()
{
        auto count = word_count();

        std::cout << "\n\n" << std::endl;

        for(auto &w: count)
        {
                std::cout << "\"" << w.first << "\""
                        << " occurs " << w.second << " time(s)\n";
        }

        return 0;
}
